-
Notifications
You must be signed in to change notification settings - Fork 68
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor bundle init
#2074
Merged
Merged
Refactor bundle init
#2074
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
shreyas-goenka
temporarily deployed
to
test-trigger-is
January 3, 2025 10:58 — with
GitHub Actions
Inactive
shreyas-goenka
temporarily deployed
to
test-trigger-is
January 3, 2025 10:59 — with
GitHub Actions
Inactive
shreyas-goenka
temporarily deployed
to
test-trigger-is
January 3, 2025 11:00 — with
GitHub Actions
Inactive
shreyas-goenka
temporarily deployed
to
test-trigger-is
January 3, 2025 11:00 — with
GitHub Actions
Inactive
shreyas-goenka
temporarily deployed
to
test-trigger-is
January 3, 2025 11:02 — with
GitHub Actions
Inactive
shreyas-goenka
temporarily deployed
to
test-trigger-is
January 3, 2025 11:02 — with
GitHub Actions
Inactive
shreyas-goenka
temporarily deployed
to
test-trigger-is
January 3, 2025 11:58 — with
GitHub Actions
Inactive
shreyas-goenka
temporarily deployed
to
test-trigger-is
January 3, 2025 11:58 — with
GitHub Actions
Inactive
shreyas-goenka
temporarily deployed
to
test-trigger-is
January 3, 2025 13:00 — with
GitHub Actions
Inactive
shreyas-goenka
temporarily deployed
to
test-trigger-is
January 3, 2025 13:00 — with
GitHub Actions
Inactive
shreyas-goenka
temporarily deployed
to
test-trigger-is
January 3, 2025 13:02 — with
GitHub Actions
Inactive
If integration tests don't run automatically, an authorized user can run them manually by following the instructions below: Trigger: Inputs:
Checks will be approved automatically on success. |
shreyas-goenka
temporarily deployed
to
test-trigger-is
January 3, 2025 13:03 — with
GitHub Actions
Inactive
shreyas-goenka
had a problem deploying
to
test-trigger-is
January 6, 2025 08:11 — with
GitHub Actions
Failure
shreyas-goenka
had a problem deploying
to
test-trigger-is
January 6, 2025 10:10 — with
GitHub Actions
Failure
shreyas-goenka
had a problem deploying
to
test-trigger-is
January 6, 2025 10:28 — with
GitHub Actions
Failure
shreyas-goenka
had a problem deploying
to
test-trigger-is
January 6, 2025 11:20 — with
GitHub Actions
Failure
shreyas-goenka
had a problem deploying
to
test-trigger-is
January 6, 2025 12:23 — with
GitHub Actions
Failure
shreyas-goenka
temporarily deployed
to
test-trigger-is
January 17, 2025 10:39 — with
GitHub Actions
Inactive
shreyas-goenka
temporarily deployed
to
test-trigger-is
January 17, 2025 10:47 — with
GitHub Actions
Inactive
shreyas-goenka
temporarily deployed
to
test-trigger-is
January 17, 2025 11:03 — with
GitHub Actions
Inactive
shreyas-goenka
temporarily deployed
to
test-trigger-is
January 17, 2025 11:05 — with
GitHub Actions
Inactive
shreyas-goenka
temporarily deployed
to
test-trigger-is
January 17, 2025 11:52 — with
GitHub Actions
Inactive
shreyas-goenka
temporarily deployed
to
test-trigger-is
January 17, 2025 12:28 — with
GitHub Actions
Inactive
shreyas-goenka
temporarily deployed
to
test-trigger-is
January 17, 2025 13:14 — with
GitHub Actions
Inactive
shreyas-goenka
temporarily deployed
to
test-trigger-is
January 17, 2025 13:59 — with
GitHub Actions
Inactive
shreyas-goenka
temporarily deployed
to
test-trigger-is
January 17, 2025 14:05 — with
GitHub Actions
Inactive
shreyas-goenka
temporarily deployed
to
test-trigger-is
January 17, 2025 14:06 — with
GitHub Actions
Inactive
pietern
approved these changes
Jan 20, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please TAL at the remaining open comments before merging.
shreyas-goenka
temporarily deployed
to
test-trigger-is
January 20, 2025 11:47 — with
GitHub Actions
Inactive
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary of changes
This PR introduces three new abstractions:
Resolver
: Resolves which reader and writer to use for a template.Writer
: Writes a template project to disk. Prompts the user if necessary.Reader
: Reads a template specification from disk, built into the CLI or from GitHub.Introducing these abstractions helps decouple reading a template from writing it. When I tried adding telemetry for the
bundle init
command, I noticed that the code incmd/init.go
was getting convoluted and hard to test. A future change could have accidentally logged PII when a user initialised a custom template.Hedging against that risk is important here because we use a generic untyped
map<string, string>
representation in the backend to log telemetry for thedatabricks bundle init
. Otherwise, we risk accidentally breaking our compliance with our centralization requirements.Details
After this PR there are two classes of templates that can be initialized:
databricks
template: This could be a builtin template or a template outside the CLI like mlops-stacks, which is still owned and managed by Databricks. These templates log their telemetry arguments and template name.custom
template: These are templates created by and managed by the end user. In these templates we do not log the template name and args. Instead a generic placeholder string of "custom" is logged in our telemetry system.NOTE: The functionality of the
databricks bundle init
command remains the same after this PR. Only the internal abstractions used are changed.Tests
New unit tests. Existing golden and unit tests. Also a fair bit of manual testing.